<template>
	<!-- 账号密码登录 -->
	<view class="login">			
		 <view style="width:100%;height: 100px;" @click="black()">
			 <image src="../../../static/public/img/fanhui.png" style="width:20px;height: 20px;margin-top: 15%;margin-left: 5%;"></image>
		 </view>
		 <view style="width:92%;margin-left: 4%;background: #090909;border-radius: 10px;">
			 <view style="width:100%;height: 50px;border-bottom: 1px solid #303336;">
				 <view style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left:10%;"><text style="color: #ffd184;">*</text>会员账号</view>
				 <input type="number" placeholder="请输入会员账号" style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left: 3%;">
			 </view>
			 <view style="width:100%;height: 50px;border-bottom: 1px solid #303336;">
			 				 <view style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left:10%;"><text style="color: #ffd184;">*</text>登录密码</view>
			 				 <input type="number" placeholder="请输入登录密码" style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left: 3%;">
			 </view>
			 <view style="width:100%;height: 50px;border-bottom: 1px solid #303336;">
			 				 <view style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left:10%;"><text style="color: #ffd184;">*</text>确认密码</view>
			 				 <input type="number" placeholder="请输入确认密码" style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left: 3%;">
			 </view>
			 <view style="width:100%;height: 50px;border-bottom: 1px solid #303336;">
			 				 <view style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left:10%;"><text style="color: #ffd184;">*</text>邀请码</view>
			 				 <input type="number" placeholder="请输入邀请码" style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left: 3%;">
			 </view>
			 <view style="width:100%;height: 50px;border-bottom: 1px solid #303336;">
			 				 <view style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left:10%;"><text style="color: #ffd184;">*</text>验证码</view>
			 				 <input type="number" placeholder="请输入验证码" style="color:white;font-size: 12px;float: left;height: 50px;line-height: 50px;margin-left: 3%;">
							 <image src="../../../static/public/img/yzm.png" style="width: 40px;height: 40px;float: left;margin-top: 1%;margin-left: 3%;"></image>
			 </view>
			 
		 </view>
		 
		 <view style="width:92%;margin-left: 4%;background: #090909;color: #f7cf94;font-size: 12px;float: left;height: 30px;line-height: 30px;">
		 	 <view style="float: left;margin-left: 4%;">*为必填栏位</view>
			
			  <view style="width:100%;background: #090909;float: left;padding-bottom:10%;">
				  <button style="margin-top: 10%;color: #614b33;background-image: linear-gradient(180deg,#e6b87a,#d49a53 80%);width:90%;margin-left: 5%;">注册</button>
				  <view style="width:100%;color: #f7cf94;text-align: center;font-size: 12px;float: left;height: 35px;line-height: 35px;margin-top: 5%;">
				  			  <image src="../../../static/public/img/zxkf.png" style="width: 20px;height: 20px;float: left;left: 40%;top: 23%;"></image>
				  			 在线客服
				  </view> 
			  </view>
			  
			 
		 </view>

	</view>
</template> 

<script> 
	export default {
		data() {
			return {
				
			}
		},

		methods: {
			// 跳转 注册账号 页面
			gotoRegister() {
				uni.navigateTo({
					url: '/pages/components/login/register_true'
				})
			},
			black(){
				uni.navigateTo({
					url: '/pages/components/login/login'
				})
			},
			// 登录
			login() {
				var self = this
				if (this.isAllSet) {
					// console.log('点击登录')
					this.$refs.uForm.validate(valid => {
						if (valid) {
							this.isVerificationPass = true;
							// 发起登录请求
							self.$u.post('http://z5.kefu123.site/api/user/login',{
								mobile: this.form.phoneNum,
								password: this.form.password
							}).then(res => {
								// console.log(res);
								const authStatus = res.data.userinfo.auth_status
								// 保存实名认证的状态
								uni.setStorageSync('auth_status',authStatus)
								// // console.log(uni.getStorageSync('auth_status'))
								uni.showLoading({
									title:'登录中...'
								})
								setTimeout(()=>{
									uni.switchTab({
										url: '/pages/components/home/home'
									});
								},2000)
								
	
							}).catch(res => {
								// console.log("密码有错误"+res)
							})
							
							// console.log('验证通过');
						} else {
							// console.log('验证失败');
						}
					})
				}
			},
	
		},
		onReady() {
	
		}
	}
</script>

<style lang="scss" scoped>
	page{
		    background-image: url(../../../static/public/img/bg.aaaf255.png);
	}
	// 账号密码登录
	.login {
	  uni-checkbox .uni-checkbox-input {
			width: 22px;
			height: 22px;
		}
	}
</style>
